﻿<%@ Page Title="" Language="C#" MasterPageFile="~/THDC.Master" AutoEventWireup="true" CodeBehind="KetQua.aspx.cs" Inherits="TracNghiemTinHocDaiCuong.KetQua" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server">
    <div class="deThi">
        <table border="1px solid blue" width="50%" cellpadding="50px" style="margin-left:25%; margin-bottom: 5%">
            <tr>
                <td style="font-size:xx-large; color: red; text-align: center">
                    Điểm của bạn: <asp:Label ID="lblDiem" runat="server"></asp:Label>
                </td>
            </tr>
        </table>
        <asp:ListView ID="lvTest" runat="server" OnPagePropertiesChanged="lvTest_PagePropertiesChanged">
            <LayoutTemplate>
                <table>
                    <tr> 
                        <div runat="server" id="itemPlaceHolder">
                            <div id="Div1" runat="server"></div>
                            <div id="Div2" runat="server"></div>
                            <div id="Div3" runat="server"></div>
                            <div id="Div4" runat="server"></div>
                            <div id="Div5" runat="server"></div>
                        </div>
                    </tr>
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <div class="deBai">
                            <asp:LinkButton ID="lkbtnDeBai" runat="server" Font-Bold="true" >
                                Câu <%# Container.DataItemIndex + 1 %>:
                            </asp:LinkButton>
                            <asp:HiddenField ID="hdfSTT" runat="server" Value='<%# Container.DataItemIndex + 1 %>'/>
                            <asp:Label ID="lblDeBai" runat="server" Text='<%# Eval("NoiDung") %>'></asp:Label>
                            <asp:HiddenField ID="hdfMaCH" runat="server" Value='<%# Eval("MaCH") %>' />
                        </div>
                        <div class="dapAnA">
                            <asp:RadioButton ID="rdoDapAnA" GroupName="DapAn" runat="server" 
                            Text='<%# Eval("DapAnA") %>' />
                            <br />
                            <asp:RadioButton ID="rdoDapAnB" GroupName="DapAn" runat="server" 
                            Text='<%# Eval("DapAnB") %>' />
                            <br />
                            <asp:RadioButton ID="rdoDapAnC" GroupName="DapAn" runat="server" 
                            Text='<%# Eval("DapAnC") %>' />
                            <br />
                            <asp:RadioButton ID="rdoDapAnD" GroupName="DapAn" runat="server" 
                            Text='<%# Eval("DapAnD") %>' />
                        </div>
                        <br />
                    </td>
                    <td class="DoRongDapAn">
                        <asp:Label ID="lblKetQua" runat="server" ForeColor="Blue" Font-Bold="true">
                        <%# (DapAnNguoiDung(Convert.ToInt32(Eval("MaCH").ToString()))
                                                        == DapAnDung(Convert.ToInt32(Eval("MaCH").ToString()))) ? "Đúng" :
                                                        ("<span style='color:red'>Sai.\nĐáp án " + DapAnDung(Convert.ToInt32(Eval("MaCH").ToString())) + "</span>")%>
                        </asp:Label>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:ListView>
        <asp:DataPager ID="dpTest" runat="server" PageSize="10" OnPreRender="dpTest_PreRender"
        PagedControlID="lvTest">
            <Fields>
                <asp:NumericPagerField ButtonCount="3" 
                CurrentPageLabelCssClass="CurrentPage"
                NumericButtonCssClass="PageNumbers"
                NextPreviousButtonCssClass="PageNumbers"
                NextPageText=" > "
                PreviousPageText=" < "/>
            </Fields>
        </asp:DataPager>
    </div>
</asp:Content>
